package com.voute.Model.Impl;

import com.voute.Api.FeedDetailInfoService;
import com.voute.Model.Bean.BaseBean;
import com.voute.Model.Bean.FeedCommentBean;
import com.voute.Model.Bean.FeedDetailInfoBean;
import com.voute.Model.Bean.VoteResultBean;
import com.voute.Model.IFeedDetailInfoModel;
import com.voute.Utils.ServiceFactory;

import java.util.HashMap;

import rx.Observable;

/**
 * Created by liucxu on 2017/4/28.
 */

public class FeedDetailInfoModelImpl implements IFeedDetailInfoModel {
    @Override
    public Observable<FeedDetailInfoBean> queryFeedDetailInfo(String feed_hash) {
        return ServiceFactory.GetInstance().createService(FeedDetailInfoService.class).queryFeedDetailInfo(feed_hash);
    }

    @Override
    public Observable<VoteResultBean> voteFeed(String hash,HashMap<String,String> params) {
        return ServiceFactory.GetInstance().createService(FeedDetailInfoService.class).voteFeed(hash,params);
    }

    @Override
    public Observable<FeedCommentBean> queryMoreComments(String hash, String page) {
        return ServiceFactory.GetInstance().createService(FeedDetailInfoService.class).queryMoreComments(hash,page);
    }

    @Override
    public Observable<BaseBean> upVote(String cid) {
        return ServiceFactory.GetInstance().createService(FeedDetailInfoService.class).upVote(cid,"value");
    }

    @Override
    public Observable<BaseBean> reportFeed(String hash, String reason) {
        return ServiceFactory.GetInstance().createService(FeedDetailInfoService.class).reportFeed(hash,reason);
    }
}
